Don't leak a file descriptor, and don't make the error dialog modal.
authorMattthias Clasen <mclasen@redhat.com>
Sun, 29 Apr 2007 18:03:35 +0000 (18:03 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 29 Apr 2007 18:03:35 +0000 (18:03 +0000)
2007-04-29  Mattthias Clasen  <mclasen@redhat.com>

        * gtk/gtkprintoperation-unix.c
        (_gtk_print_operation_platform_backend_launch_preview):
        Don't leak a file descriptor, and don't make the error
        dialog modal.  (#421985, Morten Welinder)

svn path=/trunk/; revision=17708

ChangeLog
gtk/gtkprintoperation-unix.c

index f27abba62cc308cddab24ea3a7a50184ef739fb3..98f652bec1cea21e70d4b48f2cb236a68f6a5e5a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-04-29  Mattthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkprintoperation-unix.c 
+       (_gtk_print_operation_platform_backend_launch_preview):
+       Don't leak a file descriptor, and don't make the error
+       dialog modal.  (#421985, Morten Welinder)
+
 2007-04-29  Xan Lopez  <xan@gnome.org>
 
        * docs/faq/gtk-faq.sgml: Fix typo in FAQ (#373706,
index c65cfa5070790daffc5510deebc3fe60b22024ff..d254c5ffed3feb675def8af281f9594117131ffe 100644 (file)
@@ -212,8 +212,6 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
   if (!gtk_print_settings_to_file (print_settings, settings_filename, &error))
     goto out;
 
-  close (fd);
-
   settings = gtk_settings_get_for_screen (screen);
   g_object_get (settings, "gtk-print-preview-command", &preview_cmd, NULL);
 
@@ -235,6 +233,8 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
   g_strfreev (argv);
 
  out:
+  close (fd);
+
   if (error != NULL)
     {
       GtkWidget *edialog;
@@ -245,7 +245,6 @@ _gtk_print_operation_platform_backend_launch_preview (GtkPrintOperation *op,
                                         _("Error launching preview") /* FIXME better text */);
       gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (edialog),
                                                 "%s", error->message);
-      gtk_window_set_modal (GTK_WINDOW (edialog), TRUE);
       g_signal_connect (edialog, "response",
                         G_CALLBACK (gtk_widget_destroy), NULL);